/**
 * 该文件为count组件生成action对象
 */
import { INCREAMENT, DECREAMENT } from '../constant'
export const increament = (data) => {
  return {
    type: INCREAMENT,
    data
  }
}

export const decreament = (data) => {
  return {
    type: DECREAMENT,
    data
  }
}

// 异步action 返回为函数 ，异步action一般会调用同步的action
export const increamentAsync = (data, time = 500) => {
  return (dispatch) => {
    setTimeout(() => {
      dispatch(increament(data))
    }, time)
  }
}